<style src="./index.scss" lang="scss" scoped rel="stylesheet/scss"></style>
<template src="./index.html"></template>
<script>
export default {
    name: "SelectResources",
    props: {
        // 传入的数据
        value: {
            type: Object,
            default: [],
        },
    },
    computed: {
        toperate() {
            return this.$vFN.Tools.toWeekString(this.value);
        },
    },
    data() {
        return {};
    },
    methods: {
        deleteData(_index) {
            // console.log('删除')
            //   console.log(_index)
            this.$confirm("确定删除选中内容么", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                dangerouslyUseHTMLString: true,
            })
                .then(async () => {
                    this.value.splice(_index, 1);
                })
                .catch(() => {});
            
        },

        openBox(index) {
            // 选择 适用日期
            this.$vFN.Directives.SelectDateCycleApplication({
                list: this.value,
                index: index,
                onSuccess: (res) => {
                    this.$emit("input", res.list);
                    // console.error(this.value);
                },
            });
        },

        updateData() {
            this.$emit("input", this.value);
        },
    },
    watch: {},
    mounted() {},
    beforeCreate() {},
};
</script>
